﻿using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text.Json.Serialization;
using Volo.Abp.Domain.Entities;

namespace MetroManagement
{
    /// <summary>
    /// 乘车记录类
    /// </summary>
    public class Record : Entity<int>
    {
        /// <summary>线路Id</summary>
        public int LineId { get; protected set; }

        /// <summary>上车站点</summary>
        public string Start { get; protected set; }

        /// <summary>下车站点</summary>
        public string Stop { get; protected set; }

        /// <summary>上车时间</summary>
        public DateTime OnTime { get; protected set; }

        /// <summary>下车时间</summary>
        public DateTime OffTime { get; protected set; }
        
        /// <summary>价格</summary>
        public decimal Price { get; protected set; }

        /// <summary>用户Id</summary>
        public int UserId { get; protected set; }

        /// <summary>创建时间</summary>
        public DateTime CreateTime { get; protected set; }

        /// <summary>线路</summary>
        [JsonIgnore]
        [ForeignKey("LineId")]
        public Line Line { get; protected set; }
    }
}